﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace FMAPortal
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("resource/*");
            routes.IgnoreRoute("css/*");
            routes.IgnoreRoute("fonts/*");
            routes.MapRoute(
                name: "Web",
                url: "Web/{page}/{p}",
                defaults: new { controller = "Web", action = "Index", page = "default", p = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "WebAdmin",
                url: "Admin/{p}",
                defaults: new { controller = "Web", action = "Admin", p = UrlParameter.Optional }
            );
            routes.MapRoute(
                name: "DefaultApi",
                url: "services/{action}/{p}",
                defaults: new { controller = "Service", p = UrlParameter.Optional }
            );
            /*routes.MapRoute(
                name: "default",
                url: "{page}/{p}",
                defaults: new { controller = "Web", action = "Admin", page = "default", p = UrlParameter.Optional });*/
        }
    }
}